package com.example.mytayunapi.Mapper;

import com.example.mytayunapi.Entity.PurchaseRequestInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PurchaseRequestInfoMapper {
    @Select("SELECT Pm_id, User_id, Pm_image, pm_name, Pm_catagory, Pm_describe, Pm_time FROM PurchaseRequests WHERE User_id = #{userId}")
    List<PurchaseRequestInfo> selectPurchaseRequestsByUserId(@Param("userId") String userId);



        @Delete("DELETE FROM PurchaseRequests WHERE Pm_id = #{pmId}")
        int deletePurchaseRequest(Integer pmId);

}
